package com.yaofeng.mybatis.common;

/**
 * 系统错误类型枚举类
 * Created by yaofeng on 2019/8/14.
 */
public enum ErrorCodeEnum {
    SYSTEM_ERROR(ResponseInfo.FAIL_CODE, "系统异常，请稍后重试"),

    NO_AUTHORITY(ResponseInfo.FAIL_CODE, "无权访问"),

    PARAM_ERROR(ResponseInfo.FAIL_CODE, "参数非法"),

    LOGIN_NAME__ERROR(ResponseInfo.FAIL_CODE, "账号不存在!"),
    LOGIN_NAME__EXIST(ResponseInfo.FAIL_CODE, "账号已存在,请重新填写!"),
    LOGIN_PHONE__EXIST(ResponseInfo.FAIL_CODE, "手机已存在,请重新填写!"),
    LOGIN_EMAIN__EXIST(ResponseInfo.FAIL_CODE, "邮箱已存在,请重新填写!"),
    DEPT_EXIST(ResponseInfo.FAIL_CODE, "部门名称已存在,请重新填写!"),
    ADMIN_ROLE_NOT_DELETE(ResponseInfo.FAIL_CODE, "管理员用户无法删除!"),
    DEPT_NOT_SELF(ResponseInfo.FAIL_CODE, "上级部门不能选自己!"),
    DEPT_SET_ERROR(ResponseInfo.FAIL_CODE, "上下级部门不能同时互相挂靠"),
    USER_PASSWORD_ERROR(ResponseInfo.FAIL_CODE, "密码不正确!"),
    DEPT_CHILD_EXIST(ResponseInfo.FAIL_CODE, "存在下级部门,不允许删除"),
    MENU_CHILD_EXIST(ResponseInfo.FAIL_CODE, "存在子菜单,不允许删除"),
    MENU_ROLE_EXIST(ResponseInfo.FAIL_CODE, "此菜单已授权角色,不允许删除"),
    DEPT_USER_EXIST(ResponseInfo.FAIL_CODE, "部门存在用户,不允许删除"),
    DEPT_PARENT_STOP(ResponseInfo.FAIL_CODE, "上级部门已禁用,无法添加!"),
    NOT_LOG(ResponseInfo.FAIL_CODE, "当前用户未登录,未授权");

    private Integer errCode;

    private String errMsg;

    private ErrorCodeEnum(Integer errCode, String errMsg) {
        this.errCode = errCode;
        this.errMsg = errMsg;
    }

    public Integer getErrCode() {
        return errCode;
    }

    public String getErrMsg() {
        return errMsg;
    }
}
